package com.dk.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {

    @RequestMapping("index")
    public String index() {
        return "index";
    }

    @RequestMapping("toLogin")
    public String toLogin() {
        return "login";
    }

    @RequestMapping("toRegister")
    public String toRegister() {
        return "register";
    }
    @RequestMapping("toCart")
    public String toCart() {
        return "cart";
    }

    @RequestMapping("toHomeIndex")
    public String toHomeIndex() {
        return "home-index";
    }

    @RequestMapping("toHomeSettingAddress")
    public String toHomeSettingAddress() {
        return "home-setting-address";
    }

    @RequestMapping("toGetOrderInfo")
    public String toGetOrderInfo() {
        return "getOrderInfo";
    }

    @RequestMapping("toPay")
    public String toPay() {
        return "pay";
    }

    @RequestMapping("toHomeOrderPay")
    public String toHomeOrderPay() {
        return "home-order-pay";
    }

    @RequestMapping("toHomeOrderSend")
    public String toHomeOrderSend() {
        return "home-order-send";
    }

    @RequestMapping("toHomeOrderReceive")
    public String toHomeOrderReceive() {
        return "home-order-receive";
    }


    @RequestMapping("/HomeOrderEvaluate")
    public String HomeOrderEvaluate() {
        return "home-order-evaluate";
    }

    @RequestMapping("/toComment/{goodsId}")
    public String toComment(@PathVariable("goodsId") Long goodsId, Model model) {
        model.addAttribute("goodsId",goodsId);
        return "comment";
    }

}
